#ifndef SERVER_H
#define SERVER_H

#include <QObject>
#include <QTcpServer>

#include "client.h"

class Server : public QObject
{
    Q_OBJECT
public:
    Server(int port, QObject *parent = 0);


    /**
     * @brief port gets the port the server is using
     * @return
     */
    int port() const;


    /**
     * @brief start starts the http server
     */
    void start();

    /**
     * @brief stop stops the http server
     */
    void stop();

    virtual void connectClient() { };
    virtual void disconnectClient() { };


public Q_SLOTS:
    void connectClientSlot();
    void disconnectClientSlot();


protected:
    QTcpServer *p_tcpServer;

    int v_port;
};

#endif // SERVER_H
